<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="base::header">
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body class="smoke-container">
<!--<div style="display: flex; position:relative;flex-direction:row;width: 100%;height: 100%">-->
<!--    <div style="height: 98%; background-color: white; margin: 10px; overflow: auto">-->
<!--        <form class="layui-form" action="" id="formDemo">-->
<!--            <div class="layui-form-item">-->
<!--                <label class="layui-form-label">输入框</label>-->
<!--                <div class="layui-input-block">-->
<!--                    <input type="text" name="title" required  lay-verify="required"-->
<!--                           th:url="@{/admin/menus/-1/tree}"-->
<!--                           placeholder="请输入标题" autocomplete="off" class="select-tree-tag">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="layui-form-item">-->
<!--                <label class="layui-form-label">密码框</label>-->
<!--                <div class="layui-input-inline">-->
<!--                    <input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">-->
<!--                </div>-->
<!--                <div class="layui-form-mid layui-word-aux">辅助文字</div>-->
<!--            </div>-->
<!--            <div class="layui-form-item">-->
<!--                <label class="layui-form-label">选择框</label>-->
<!--                <div class="layui-input-block">-->
<!--                    <select name="city.A" lay-verify="required"  dict-url="/admin/dictionaries?type=city">-->
<!--                        <option value=""></option>-->
<!--                        <option value="0" selected>北京</option>-->
<!--                        <option value="1" selected>上海</option>-->
<!--                        <option value="2">广州</option>-->
<!--                        <option value="3">深圳</option>-->
<!--                        <option value="4">杭州</option>-->
<!--                    </select>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="layui-form-item">-->
<!--                <label class="layui-form-label">复选框</label>-->
<!--                <div class="layui-input-block">-->
<!--                    <input type="checkbox" name="like" multiple="multiple" value="1" title="写作">-->
<!--                    <input type="checkbox" name="like" multiple="multiple" value="2" title="阅读" checked>-->
<!--                    <input type="checkbox" name="like[dai]" multiple="multiple" title="发呆">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="layui-form-item">-->
<!--                <label class="layui-form-label">开关</label>-->
<!--                <div class="layui-input-block">-->
<!--                    <input type="checkbox" name="switch" lay-skin="switch">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="layui-form-item">-->
<!--                <label class="layui-form-label">单选框</label>-->
<!--                <div class="layui-input-block">-->
<!--                    <input type="radio" name="sex" value="男" title="男">-->
<!--                    <input type="radio" name="sex" value="女" title="女" checked>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="layui-form-item layui-form-text">-->
<!--                <label class="layui-form-label">文本域</label>-->
<!--                <div class="layui-input-block">-->
<!--                    <textarea name="desc" placeholder="请输入内容" class="layui-textarea"></textarea>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="layui-form-item">-->
<!--                <div class="layui-input-block">-->
<!--                    <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>-->
<!--                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>-->
<!--                </div>-->
<!--            </div>-->
<!--        </form>-->
<!--    </div>-->

<!--</div>-->
<div id="test1"></div>
<script>
    layui.use('tree', function(){
        var tree = layui.tree;

        //渲染
        var inst1 = tree.render({
            elem: '#test1'  //绑定元素
            ,showCheckbox:true
            ,data: [{
                title: '一级1'
                ,id: 1
                ,field: 'name1'
                ,checked: true
                ,spread: true
                ,children: [{
                    checked:true,
                    title: '南昌' //二级菜单
                    ,children: [{

                        title: '高新区' //三级菜单
                        ,checked:true
                        //…… //以此类推，可无限层级
                    }]
                }]
            },{
                title: '陕西' //一级菜单
                ,children: [{
                    title: '西安' //二级菜单
                }]
            }]
        });
    });
</script>

</body>
</html>